﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SuperFox
{
    public partial class clientProduct : UserControl
    {
        public static readonly DependencyProperty DescriptionProperty =
            DependencyProperty.Register("Description", typeof(string), typeof(clientProduct),
        new PropertyMetadata("", new PropertyChangedCallback(DescriptionPropertyChanged)));

        public static readonly DependencyProperty ImageProperty =
            DependencyProperty.Register("Image", typeof(ImageBrush), typeof(clientProduct), new PropertyMetadata(null,
                                                new PropertyChangedCallback(ImagePropertyChanged)));

        public static readonly DependencyProperty LinkProperty =
            DependencyProperty.Register("Link", typeof(string), typeof(clientProduct), new PropertyMetadata(null,
                                                new PropertyChangedCallback(LinkPropertyChanged)));

        public string Link
        {
            get { return (string)GetValue(LinkProperty); }
            set { SetValue(LinkProperty, value); }
        }

        public string Description
        {
            get { return (string)GetValue(DescriptionProperty); }
            set { SetValue(DescriptionProperty, value); }
        }

        public ImageBrush Image
        {
            get { return (ImageBrush)GetValue(ImageProperty); }
            set { SetValue(ImageProperty, value); }
        }


        private static void LinkPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            
        }


        private static void ImagePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as clientProduct).ProImage.Background = e.NewValue as ImageBrush;
        }

        private static void DescriptionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as clientProduct).DescriptionTb.Text = e.NewValue as String;
        }


        public clientProduct()
        {
            InitializeComponent();
        }

        private void ProLink_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}
